/*
 * @作者: 沙昊
 * @邮箱: shahao@zju.edu.cn
 * @功能: 
 * @包含算法: 
 * Copyright (c) 2023 by 沙昊, All Rights Reserved. 
 */
// /*
//  * @作者: 沙昊
//  * @邮箱:
//  * @功能: 
//  * @包含算法: 
//  * Copyright (c) 2023 by 沙昊, All Rights Reserved. 
//  */
#include <iostream>
#include <sstream>
#include <string> 
#include <vector>
#include <queue>
#include <stack>
#include <unordered_map>
#include <iostream>
#include <list>
#include <unordered_map>
using namespace std;



// struct ListNode {
//     int val;
//     ListNode* next;
//     ListNode(int x): val(x),next(NULL){}
   
// };
// unordered_map<int,pair<ListNode*,ListNode*>> hash;

// ListNode* dummy = new ListNode(0);

// void dynamic_allocation(){

// }
// void fixed_allocation(int id){

// }
// void release(int id){

// }


int main(){
    int str_len;
    cin>>str_len;
    string input_string,output_string;
    cin>>input_string;

    string left_front,left_back;
    string right_front,right_back;

    
    string sha_result;
    int jinwei_flag=0;
    std::unordered_map <string,int> sha_map;
    // getline(cin,input_string);
    // string temp(2);
    // temp[0] = '!';
    // temp[1] = '!';
    sha_map.insert(pair<string, int>("!!", 0)); 
    sha_map.insert(pair<string, int>("!@", 13)); 
    sha_map.insert(pair<string, int>("@!", 13)); 
    sha_map.insert(pair<string, int>("!#", 4)); 
    sha_map.insert(pair<string, int>("#!", 4)); 
    sha_map.insert(pair<string, int>("@@", 7)); 
    sha_map.insert(pair<string, int>("@#",20));
    sha_map.insert(pair<string, int>("#@", 20)); 
    sha_map.insert(pair<string, int>("##", 5));


    int dian_flag=0;
    int index=0;
    for(;index<input_string.size();index++){
        char c = input_string[index]; 
        if(c=='.'){
            dian_flag = 1;
        }
        else{
            if(dian_flag==0){
                left_front.push_back(c);
            }
            else{
                left_back.push_back(c);
            }
        }

    }
    dian_flag=0;
    for(;index<input_string.size();index++){
        char c = input_string[index]; 
        if(c=='.'){
            dian_flag = 1;
        }
        else{
            if(dian_flag==0){
                right_front.push_back(c);
            }
            else{
                right_back.push_back(c);
            }
        }
    }
    int temp1 = max(left_front.size(),right_front.size());
    int temp2 = max(left_back.size(),right_back.size())
    string result_front(temp1,'0');
    string result_back(temp2, '0');

    int sum=0;
    for(int i=max(left_back.size(),right_back.size()); i>=0;i--){
        if(i>=left_back.size()){
            result_back[i] = right_back[i];
        }
        else if(i>=right_back.size()){
            result_back[i] = left_back[i];
        }
        else{
            string temp(2);
            temp[0] = left_back[i];
            temp[1] = right_back[i];
            auto iter = sha_map.find(temp); 

            if(inter !=sha_map.end()){//
                sum = inter->second;
            }
            else{
                sum = (left_back[i] - '0') + (right_back[i] - '0'); 
            }
            sum += jinwei_flag;
            result_back[i] = sum%10;
            jinwei_flag = sum/10;
        }

    }

    int l_index,r_index;
    for(int i=0; i<max(left_front.size(),right_front.size());i--){
        l_index = left_front.size()-1-i;
        r_index = right_front.size()-1-i;

        if(l_index<0){
            sum = (right_front[i]-'0') + jinwei_flag; 
        }
        else if(r_index<0){
            sum = (left_front[i]-'0') + jinwei_flag; 
        }
        else{
            string temp(2);
            temp[0] = left_front[i];
            temp[1] = right_front[i];
            auto iter = sha_map.find(temp); 

            if(inter !=sha_map.end()){//
                sum = inter->second;
            }
            else{
                sum = (left_front[i] - '0') + (right_front[i] - '0'); 
            }
            sum += jinwei_flag;

        }
        result_front[i] = sum%10;
        jinwei_flag = sum/10;

    }
    if(jinwei_flag==0){
        sha_result = result_front+"."+result_back;
    }
    else{
        sha_result = to_string(jinwei_flag)+result_front+"."+result_back;
    }


    cout<<sha_result;

}

